int I1 = 4; 
int I2 = 7; 
int pwm = 5;
int SW = 12;
int val = 0;

void setup(){
  
  Serial.begin(9600);
  
  pinMode(SW,INPUT);
  pinMode(I1, OUTPUT);
  pinMode(I2, OUTPUT);
}

void loop(){
    val = digitalRead(SW);
    analogWrite(pwm,7);
   if(val == HIGH){
       Serial.println("Spin!");
      digitalWrite(I1,LOW);
      digitalWrite(I2,HIGH);
   }
   else{
     analogWrite(pwm,0);
     Serial.println("Not working");
   }
}
